﻿#ifndef REGISTERHOTEL_H
#define REGISTERHOTEL_H

#include <QWidget>
#include "globalvars.h"

namespace Ui {
class RegisterHotel;
}

class RegisterHotel : public QWidget
{
    Q_OBJECT
signals:
    void signalSubmitHotel();
    void signalUpdateHotel();
    void signalHotelPassCert(bool,const QString&);

public:
    explicit RegisterHotel(QWidget *parent = nullptr);
    ~RegisterHotel();

    void setImages();
    void setHotelInfo();
    void allowEveryOne();
    void forbidEveryOne();
    void closePushButton();
    void setState(EditState state);
    void errorShow(const QString& msg);
    void setServerShow(QStringList serverList);

private slots:
    void on_pb_finish_clicked();
    void on_pb_cancel_clicked();
    void on_pb_uploadLicense_clicked();
    void on_pb_uploadHotelPic_clicked();

    void on_cb_freePark_clicked(bool checked);
    void on_cb_bath_clicked(bool checked);
    void on_cb_payPark_clicked(bool checked);
    void on_cb_hairDryer_clicked(bool checked);
    void on_cb_transfer_clicked(bool checked);
    void on_cb_spa_clicked(bool checked);
    void on_cb_wiredNet_clicked(bool checked);
    void on_cb_wifiNet_clicked(bool checked);
    void on_cb_baggage_clicked(bool checked);
    void on_cb_restaurant_clicked(bool checked);

    void on_cb_lowPrice_currentIndexChanged(int index);

private:
    Ui::RegisterHotel *ui;

    EditState m_state;
    QString m_licenseImagePath;
    QStringList m_imagePathList;
    QStringList m_hotelServer;

    HotelInfo m_hotel;
    void constructeCondition(bool checked, const QString& text);
};

#endif // REGISTERHOTEL_H
